package edu.nf.takeoutdemo.service;

import edu.nf.takeoutdemo.commons.result.PageResult;
import edu.nf.takeoutdemo.model.dto.*;
import edu.nf.takeoutdemo.model.vo.OrderPaymentVO;
import edu.nf.takeoutdemo.model.vo.OrderStatisticsVO;
import edu.nf.takeoutdemo.model.vo.OrderSubmitVO;
import edu.nf.takeoutdemo.model.vo.OrderVO;

/**
 *
 * @author zjl
 * @date 2025/10/30
 */
public interface OrderService {
    /**
     * 下单
     * @param orderSubmitDTO
     * @return
     */
    OrderSubmitVO submitOrder(OrderSubmitDTO orderSubmitDTO);

    /**
     * 订单支付
     * @param ordersPaymentDTO
     * @return
     */
    OrderPaymentVO payment(OrdersPaymentDTO ordersPaymentDTO) throws Exception;

    /**
     * 支付成功，修改订单状态
     * @param outTradeNo
     */
    void paySuccess(String outTradeNo);

    /**
     * 客户催单
     * @param id
     */
    void reminder(Long id);

    /**
     * 取消订单
     * @param orderCancelDTO
     */
    void cancelOrder(OrderCancelDTO orderCancelDTO) throws Exception;

    /**
     * 查询订单详情
     * @return
     */
    OrderVO getDetails(Long id);

    /**
     * 再来一单
     * @param id
     */
    void repetition(Long id);

    /**
     * 查询历史订单
     * @param pageNum
     * @param pageSize
     * @param status
     * @return
     */
    PageResult pageQueryUser(int pageNum, int pageSize, Integer status);

    /**
     * 用户取消订单
     */
    void cancelUserOrder(Long id) throws Exception;

    /**
     * 接单
     * @param orderConfirmDTO
     */
    void confirmOrder(OrderConfirmDTO orderConfirmDTO);

    /**
     * 拒单
     * @param orderRejectionDTO
     */
    void rejectionOrder(OrderRejectionDTO orderRejectionDTO) throws Exception;

    /**
     * 完成订单
     * @param id
     */
    void completeOrder(Long id);

    /**
     * 派送订单
     * @param id
     */
    void deliveryOrder(Long id);

    /**
     * 订单搜索
     * @param orderPageQueryDTO
     * @return
     */
    PageResult conditionSearch(OrderPageQueryDTO orderPageQueryDTO);

    /**
     * 查询订单各状态数量
     * @return
     */
    OrderStatisticsVO statistics();
}
